import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

///比较常用的多子布局组件是Row、Column、Stack
class MultiChildWidgetPage extends StatefulWidget {
  @override
  _MultiChildWidgetPageState createState() =>  _MultiChildWidgetPageState();
}

class _MultiChildWidgetPageState extends State<MultiChildWidgetPage> {
  @override
  Widget build(BuildContext context) {
    return  Scaffold(
        appBar: AppBar(
          title:  Text('多子布局'),
        ),
        body: Container(
          alignment: Alignment.center,
          child: Stack(
            children: [
              Container(padding: EdgeInsets.all(25), color: Colors.purple, width: 300, height: 100),
              Positioned(
                  top: 25, left: 15, child: Icon(Icons.favorite, size: 50, color: Colors.white)),
              Positioned(
                  top: 30,
                  left: 80,
                  child: Text('你好', style: TextStyle(color: Colors.white, fontSize: 25)))
            ],
          ),
        ));
  }
}
